<template>
	<scroll-view scroll-y="true" class="main" @scrolltolower="more">
		<view class="detaillist" v-for="(item,index) of list">
			<view class="detaillist_top u-m-tb-30 flex">
				<text class="u-font-28">{{item.order.catename}}</text>
				<text class="u-font-bold u-font-32" style="color: #00CE9B;">+￥{{item.num}}</text>
			</view>
			<view class="detaillist_top flex u-font-22">
				<text style="color: #C9CCD5;">{{item.createtime | date}}</text>
				<text style="color: #8D93A5;">项目总价¥{{item.order.orderprice}}</text>
			</view>
		</view>
		<u-empty mode="list" v-if="finish && list.length === 0" style="margin-top: 200rpx;" icon="/static/none.png">
				</u-empty>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				page:1,
				list:[],
				finish: false,
			};
		},
		onReachBottom() {
			
		},
		
		onLoad() {
			this.reload()
		},
		methods:{
			reload() {
				this.page = 1
				this.list = []
				this.finish = false
				this.getList()
			},
			more() {
				this.page++
				this.getList()
			},
			getList(){
				this.$api.post('/channelinfo',{types:'list',page:this.page}).then(res=>{
					this.list = res.data
					if (res.data.length === 0) {
						this.finish = true
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.main{
		height: 100vh;
		overflow: hidden;
	}
.detaillist{
	border-radius: 30rpx;
	background-color: #fff;
	padding: 30rpx;
	width: 90%;
	margin: 30rpx auto;
	.detaillist_top{
		justify-content: space-between;
	}
}
.center{
	transform: translateY(50%);
}
</style>
